<?php
require_once '../Model/Database/OPDatabase.php';

class DatabaseTest extends PHPUnit_Framework_TestCase {
	
	public function setUp() {
		OPDatabase::connect();
		
 		$rockPosition 	= OPPosition::newWithLatitudeLongitude(1, 1);
 		$this->rock 	= OPRock::newWithPositionAndANumberOfPlayersToMove($rockPosition, 2);
 		$this->rock->save();
 		
 		$player1Position 	= OPPosition::newWithLatitudeLongitude(1, 2);
 		$this->player1		= OPPlayer::newWithPosition($player1Position);
 		$this->player1->save();
 		
  		$player2Position 	= OPPosition::newWithLatitudeLongitude(2, 1);
  		$this->player2		= OPPlayer::newWithPosition($player2Position);
  		$this->player2->save();
		
	}
	
	public function tearDown() {
		OPDatabase::clear();
		
	}
	
	/**
	 * @test
	 */
	public function rockCanMove() {
		$this->assertTrue($this->rock->canMove());
		
	}
	
	
}